package com.pinyoumei.app.activity.ShoppingCenter.taobao;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.widget.ImageView;

import com.pinyoumei.app.R;
import com.pinyoumei.app.activity.BaseActivity;
import com.next.easynavigation.constant.Anim;
import com.next.easynavigation.view.EasyNavigationBar;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2020-12-04.
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2020-12-04        Administrator             新增Person类
 * 2020-12-04        Administrator             增加sex属性
 * 淘宝专区
 */
public class ShopTaoMainActivity extends BaseActivity {

    private List<Fragment> fragments = new ArrayList<>();
    private int[] selectIcon =   new int[]{
            R.mipmap.ic_shop_center_main_bg11,R.mipmap.ic_shop_center_bill_bg};


    private int[]  normalIcon = new int[]{R.mipmap.ic_shop_center_main_bg,
            R.mipmap.ic_shop_center_bill_bg11};

    private String[] tabText = {"首页", "我的订单"};
    private EasyNavigationBar navigationBar;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shop_tao);

        InitWidget();

        InitData();



    }


    private void InitWidget() {

        navigationBar = findViewById(R.id.navigationBar);

    }


    private void InitData() {
        //首页
        fragments.add(new TaoBaoMainFragment());
        //订单
        fragments.add(new ToaBaoBillFragment());



        //添加文字
        navigationBar.titleItems(tabText)
                //Tab文字大小
                .tabTextSize(12)
                //Tab文字距Tab图标的距离
                .tabTextTop(2)
                //Tab未选中时字体颜色
                .normalTextColor(this.getResources().getColor
                        (R.color.loan_unselect_text_color))
                //Tab选中时字体颜色
                .selectTextColor(this.getResources().getColor
                        (R.color.loan_select_text_color))
                //导航栏高度
                .navigationHeight(51)
                //分割线高度  默认1px
                .lineHeight(1)
                //分割线的颜色
                .lineColor(this.getResources().getColor(R.color.line_color))
                //同 ImageView的ScaleType
                .scaleType(ImageView.ScaleType.FIT_CENTER)
                //导航栏背景色
                .navigationBackground(this.getResources().getColor(R.color.white))
                //点击Tab  Viewpager切换是否有动画
                .smoothScroll(false)
                //Viewpager能否左右滑动
                .canScroll(false)
                //点击Tab时的动画ZoomIn BounceIn
                .anim(Anim.BounceIn)
                //未选中时icon
                .normalIconItems(normalIcon)
                //选中时icon
                .selectIconItems(selectIcon)
                .fragmentList(fragments)
                .fragmentManager(getSupportFragmentManager())
                .mode(EasyNavigationBar.MODE_NORMAL)
                .addLayoutRule(EasyNavigationBar.RULE_CENTER)
                .addAsFragment(true)
                .build();


    }


}





